/**
 * 
 */
package it.uniroma3.dia.digraph.util;

/**
 * @author Cionzo
 *
 */
import javax.xml.transform.*;
import java.net.*;
import java.io.*;

public class HowToXSLT {
public static void transform(String file) {
    String pathSeparator = System.getProperty("path.separator");
    String xslt = "xml"+pathSeparator+"xslt"+pathSeparator+
    	"graphml2cionz"+pathSeparator+"transform.xsl";
    String output = file.substring(0, file.lastIndexOf("."))+"X.xml";
  try {

    TransformerFactory tFactory = TransformerFactory.newInstance();

    Transformer transformer =
      tFactory.newTransformer
         (new javax.xml.transform.stream.StreamSource
            (xslt));

    transformer.transform
      (new javax.xml.transform.stream.StreamSource
            (file),
       new javax.xml.transform.stream.StreamResult
            ( new FileOutputStream("howto.html")));
    }
  catch (Exception e) {
    e.printStackTrace( );
    }
  }
}
